<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Config extends CI_Controller {

	public function index(){
	   $this->load->model('Configs', null, true);
       $data['Configs'] = $this->Configs->getList();
		$this->load->view('config/index', $data);
	}
    
    /**
     * edit save config id
     * @author tien.nguyen
     */
    public function edit($configId){
        $res = false;
        $this->load->model('Configs', null, true);
        
        if($this->input->post()){
            $data = $this->input->post();            
            if($this->Configs->edit($data, $configId)){
                $res = true;           
            }    
        }
        header('Content-Type: application/json',true);
        echo json_encode(array('res' => $res));
    }
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */